package io.renren.modules.mybog.fromControoler;

import io.renren.common.utils.R;
import io.renren.modules.mybog.entity.CatePost;
import io.renren.modules.mybog.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/bolg/catepost")
public class CatePostControolers {
    @Autowired
    private CategoryService categoryService;


    /**
     * 查询分类	 帖子的数量
     * @return
     */
    @RequestMapping("/list")
    public R list(){
       List<CatePost> posts=categoryService.getListCatePost();
       return  R.ok().put("data",posts);
    }
}
